package networkmodule.message;

import java.util.HashMap;
import java.util.Map;

import com.google.gson.Gson;

import config.Config;

public class SensorMessage extends BaseNetworkMessage {
	private Map<String, Float> _accels = new HashMap<String, Float>();
	private Map<String, Float> _magOrientation = new HashMap<String, Float>();
	
	@Override
	public String serialize() {
		Map<String, Object> map = new HashMap<>();
		map.put(Config.TAG_MSGTYPE, _type);
		map.put(Config.TAG_ACCELER, _accels);
		map.put(Config.TAG_MAGORIENT, _magOrientation);
		
		Gson gson = new Gson();
		String result = gson.toJson(map); 
		return result;
	}

	@Override
	public void deserializable(String json) {
		// TODO Auto-generated method stub
		super.deserializable(json);
	}

	public SensorMessage() {
		super(Config.MESSAGETYPE_SENSOR);
	}


	public Map<String, Float> getAccels() {
		return _accels;
	}

	public Map<String, Float> getMagOrientation() {
		return _magOrientation;
	}
}
